#pragma once

#include "CoreMinimal.h"
#include "Blueprint/UserWidget.h"
#include "Components/Button.h"
#include "Components/TextBlock.h"
#include "GameHUD.generated.h"

UCLASS()
class UGameHUD : public UUserWidget
{
	GENERATED_BODY()

public:
	virtual void NativeConstruct() override;

	APlayerController* GetController();

	void Show();

	void PlayDamageAnimation() { PlayAnimation(DamageAnimation); }

protected:
	int Num = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "通用设置", meta = (BindWidget))
	TObjectPtr<UButton> AddButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "通用设置", meta = (BindWidget))
	TObjectPtr<UButton> BackButton;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "通用设置", meta = (BindWidget))
	TObjectPtr<UTextBlock> NumberText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "通用设置", meta = (BindWidgetAnim), Transient)
	TObjectPtr<UWidgetAnimation> DamageAnimation;

	UFUNCTION()
	void Add();

	UFUNCTION()
	void Back();
};
